package cn.service.Impl;

import cn.dao.DepartmentDao;
import cn.domain.Department;
import cn.domain.PageBean;
import cn.service.DepartmentService;
import cn.utils.HQLHelper;
import org.jbpm.api.ProcessEngine;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/3/14 0014.
 */
@Service
@Transactional
public class DepartmentServiceImpl implements DepartmentService {
    @Resource
    private DepartmentDao departmentDao;
    @Resource
    private ProcessEngine processEngine;
    @Override
    public void save(Department department) {
        System.out.println(processEngine);
        departmentDao.save(department);
    }

    @Override
    public List<Department> Top() {
        return departmentDao.topList();
    }

    @Override
    public List<Department> Down(Long id) {
        return departmentDao.downList(id);
    }

    @Override
    public List<Department> findAll() {
        return departmentDao.findAll();
    }

    @Override
    public Department getById(Long id) {
        return departmentDao.getById(id);
    }

    @Override
    public List<Department> getByIds(Long[] id) {
        return departmentDao.getByIds(id);
    }

    @Override
    public void update(Department department) {
        departmentDao.update(department);
    }

    @Override
    public void delete(Long id) {
        departmentDao.delete(id);
    }

    @Override
    public PageBean getPageBean(HQLHelper hqlHelper, int currentPage) {
        return departmentDao.getPageBean(hqlHelper,currentPage);
    }
}
